var arr1 = [3, 4, 2, 1, 8, 5];
//默认是升序
/*arr1.sort();
console.log(arr1);*/
//自定义排序规则:降序排序
arr1.sort(function (a, b) {
    return b - a;
});
console.log(arr1);
